package com.hongning.railway.ui.main.fragments.cadremanagement;

import android.app.Application;
import android.databinding.ObservableField;
import android.os.Bundle;
import android.support.annotation.NonNull;

import com.hongning.railway.data.AppRepository;
import com.hongning.railway.entity.reqbean.RosterBean;
import com.hongning.railway.entity.reqbean.ThreesessionSanDoneLessonBean;
import com.hongning.railway.ui.main.fragments.threesessionsandonelesson.ThreesessionSanDoneLessonFragmentInfo;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class CadreManagementRosterListItemViewModel  extends  ItemViewModel<BaseViewModel>  {
    public ObservableField<RosterBean> rosterBeans= new ObservableField<>();

    public BindingCommand onItemClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            Bundle bundle = new Bundle();
            bundle.putSerializable("RosterBean",rosterBeans.get());
            viewModel.startContainerActivity(CadreManagementRosterInfoFragment.class.getCanonicalName(),bundle);
        }
    });
    public CadreManagementRosterListItemViewModel(@NonNull BaseViewModel viewModel,RosterBean rosterBean,int index) {
        super(viewModel);
        rosterBean.setIndex(String.valueOf(index));
        rosterBeans.set(rosterBean);
    }
}
